#include "Transformation.h"
#include <math.h>

#ifndef _RECT
#include "Rectangular.h"
#endif

#ifndef _POL
#include "Polar.h"
#endif

#ifndef _STANDAR
#define "standar.h"
#endif

Action 
Transformation::rectangularToPolar(Rectangular &numR,/*CN Rectangular*/
                                   Polar &numP       /*CN Polar*/)
{
   numP.setMagnitude(sqrt(numR.getReal()*numR.getReal() 
                     + numR.getImaginary()*numR.getImaginary()));  
   numP.setAngle(atan2f(numR.getImaginary(),numR.getReal()));
   return SUCCESS;
}

Action 
Transformation::polarToRectangular(Polar &numP,      /*CN Polar*/
                                   Rectangular &numR /*CN Rectangular*/)
{
   numR.setReal(numP.getMagnitude()*cosf(numP.getAngle()));
   numR.setImaginary(numP.getMagnitude()*sinf(numP.getAngle()));
   return SUCCESS; 
}

/* Abbreviation Table
* numR == number Real
* numP == number Polar
*/
